package com.example.quiz.dao;

import com.example.quiz.model.WrongQuestion;
import org.apache.ibatis.annotations.Param;
import java.util.List;

public interface WrongQuestionMapper {
    int insert(WrongQuestion wrongQuestion);

    int deleteById(Long id);

    int deleteByUserId(Long userId);

    WrongQuestion selectById(Long id);

    List<WrongQuestion> selectAll();

    List<WrongQuestion> selectByUserId(Long userId);

    List<WrongQuestion> selectPagedQuestions(
            @Param("offset") int offset,
            @Param("limit") int limit,
            @Param("userId") Long userId);

    int selectTotalCount(@Param("userId") Long userId);

    int update(WrongQuestion wrongQuestion);

    WrongQuestion selectByUserAndQuestion(@Param("userId") Long userId, @Param("questionId") Long questionId);

    int updateCreatedAt(Long id);

    int deleteByUserAndQuestion(@Param("userId") Long userId, @Param("questionId") Long questionId);

    int deleteByQuestionId(@Param("questionId") Long questionId);
}